#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    int arr[10] = {12, 15, 81, 341, 1851, 515, 24, 81, 16, 841};

    int target = 81;

    auto search_start = arr; 
    int count = 0;

    while (true)
    {
        auto result = find(search_start, arr + 10, target);

        if (result != arr + 10)
        {
            count++;
            cout << "第" << count << "次找到元素，位置：" << result - arr
                 << "，值：" << *result << endl;
            search_start = result + 1; // 从下一个位置继续搜索
        }
        else
        {
            if (count == 0)
            {
                cout << "未找到元素" << endl;
            }
            else
            {
                cout << "搜索完成，共找到 " << count << " 个元素" << endl;
            }
            break;
        }
    }
    return 0;
}